<div class="row-fluid">
<section class="span9 info-annonce">
    <ul class="breadcrumb" itemscope itemtype="http://data-vocabulary.org/Breadcrumb" >
	    <li><a href="<?php echo $CFG->config['base_url']?>" itemprop="url" ><i class="icon-home"></i></a> <span class="divider">› </span></li>
	    <?php if(isset($annonce->breadcrumb_category['parent'])):?>
	    <li><a href="<?php echo  $CFG->config['base_url'].$annonce->breadcrumb_category['parent']->link?>" itemprop="url"><span itemprop="title"><?php echo $annonce->breadcrumb_category['parent']->name?></span></a> <span class="divider">› </span></li>
	    <?php endif;
	    if(isset($annonce->breadcrumb_category['child'])):?>
	    <li><a href="<?php echo  $CFG->config['base_url'].$annonce->breadcrumb_category['child']->link?>" itemprop="url" ><span itemprop="title"><?php echo $annonce->breadcrumb_category['child']->name?></span></a> <span class="divider">› </span></li>
	    <?php endif;?>
	    <li class="active"><span itemprop="title"><?php echo  $annonce->prd_name?></li>
    </ul>
	<article class="annonce" itemscope itemtype="http://schema.org/Product" >
		<header class="page-header">
		    <h2 itemprop="name" ><?php echo  $annonce->prd_name?></h2>
		    Catégorie : <span content="<?php echo  str_replace('/' ,' > ', $annonce->link_category)?>"><?php echo  $annonce->category_name?></span>
		    <p>Mise en ligne par <span><?php echo  $annonce->user_name?></span> - <time datetime="<?php echo  date('Y-m-d H:i:s',$annonce->date_validate)?>"><?php echo  $annonce->date?></time>
		    </p>
		</header>
		<?php if(isset($annonce->photo)):?>
		<div class="wrap-image carousel " id="Carousel" >
			<img  itemprop="image" class="img-polaroid" alt="<?php echo  $annonce->prd_name?>" src="<?php echo  $CFG->config['base_url'].'images/'.$annonce->link_photo?>"/>
			 <a class="carousel-control left" href="#Carousel" data-slide="prev">&lsaquo;</a>
			 <a class="carousel-control right" href="#Carousel" data-slide="next">&rsaquo;</a>
		</div>		
		<?php endif;?>
		<?php if(isset($annonce->photo) and count($annonce->photo)>1){?>
		<div class="row-fluid">
		<ul class="thumbnails">
			<?php foreach ($annonce->photo as $i=>$photo):?>
			<li class="thumbnail pull-left"><img  itemprop="image" data-src="holder.js/260x180" alt="<?php echo  $annonce->prd_name." thumbnail $i"?>" src="<?php echo  $CFG->config['base_url'].'images/thumbnails/'.$photo?>"/></li>
			<?php endforeach;?>
		</ul>
		</div>
		<?php } echo "<br/>"?>

		<ul class="info-supplementaire" itemscope itemtype="http://schema.org/PostalAddress" >
				<?php if($annonce->prd_price) {?>
					<li  itemscope itemtype="http://schema.org/Offer" >
						<span class="label-price" >Prix </span><strong class="price text-orange" itemprop="price"><?php echo  $annonce->prd_price?> €</strong>
						<meta itemprop="priceCurrency" content="EUR"/>
					</li>
				<?php }?>
				<li><span>Ville </span><i itemprop="addressLocality"><?php echo  $annonce->ville?></i></li>
				<li><span>Code postal </span><i itemprop="postalCode"><?php echo  $annonce->prd_codepostal?></i></li>
				<?php if(!empty($annonce->option)) 
					foreach ($annonce->option as $id=>$option):
						if($option){
							$marque= ($annonce->option_label[$id]=='Marque')?' itemprop="brand" ':'';
				?>
				<li><span><?php echo $annonce->option_label[$id]?></span><?php echo  "<i $marque> $option</i> ".$annonce->option_unit[$id]?></li>
				<?php 
					}
				endforeach;?>
		</ul>
		<br class="clear"/>
		<h6>Description :</h6>
		<p class="description"  itemprop="description" >
		<?php if($annonce->prd_youtube){
	    		$youtubeRegexp = "#(/v/|/watch\?v=)([A-Za-z0-9_-]{5,11})#";
				$embedUrl = preg_replace($youtubeRegexp, '/embed/$2', $annonce->prd_youtube);
	    		echo '<iframe class="youtube" width="420" height="315" src="'.$embedUrl.'" frameborder="0" allowfullscreen></iframe>
				';
	   		}
	   	 echo  $annonce->prd_description ?>
		</p>
	</article>

<div>
	
	<a class="btn btn-success btn-small" href="<?php echo $CFG->config['base_url'].'annonce/envoyer/mail/'.$annonce->prd_id?>"> <span class="icon-envelope"></span> Contacter par email </a>
	<?php if(!$annonce->user_tel_show):?>
	<button class="btn btn-success btn-small" onclick="$('#viewBtn').hide();$('#hidePhone').show()"> <span class="icon-user"></span> <span id="viewBtn">Voir le téléphone <?php echo  $annonce->user_name?></span> <span id="hidePhone" class="hide"> <?php echo  $annonce->user_tel?></span></button> 
	<?php endif;?>
	<a class="btn btn-primary btn-small" href="<?php echo $CFG->config['base_url'].'annonce/gerer/signaler/'.$annonce->prd_id?>"> <span class="icon-remove"></span> Signaler un contenu abusif</a> 
	<a class="btn btn-primary btn-small" href="<?php echo $CFG->config['base_url'].'annonce/gerer/envoyer_a_ami/'.$annonce->prd_id?>"> <span class="icon-comment"></span> Envoyer à un ami</a> 
	<a class="btn btn-primary btn-small" href="<?php echo $CFG->config['base_url'].'annonce/gerer/imprimer/'.$annonce->prd_id?>"> <span class="icon-print"></span> Imprimer</a>
	<a class="btn btn-warning btn-small" href="<?php echo $CFG->config['base_url'].'annonce/gerer/sauvegarder/'.$annonce->prd_id?>"> <span class="icon-check"></span> Sauvegarder </a> 
</div>

<!-- 
   <div id="fb-root"></div>
	<script>(function(d, s, id) {
	  var js, fjs = d.getElementsByTagName(s)[0];
	  if (d.getElementById(id)) return;
	  js = d.createElement(s); js.id = id;
	  js.src = "//connect.facebook.net/fr_FR/all.js#xfbml=1";
	  fjs.parentNode.insertBefore(js, fjs);
	}(document, 'script', 'facebook-jssdk'));</script>
	<br/>
	<div class="fb-like" data-href="<?php echo $CFG->config['base_url'].$annonce->link_category.'/'.$annonce->prd_link?>.html" data-send="true" data-layout="button_count" data-width="350" data-show-faces="true"></div>
 -->
</section>

<aside class="span3 category-aside" >
    <ul class="nav nav-list" >
	    <li class="nav-header">Contacter l'annonceur</li>
	    <li><a href="<?php echo $CFG->config['base_url'].'annonce/envoyer/mail/'.$annonce->prd_id?>"><span class="icon-envelope"></span><strong> Envoyer un email </strong></a></li>
		<?php if(!$annonce->user_tel_show):?>
		<li><span class="icon-user"></span> <?php echo  $annonce->user_name?> : <?php echo  $annonce->user_tel?></li>
		<?php endif;?>
		<li class="divider"></li>
	    <li class="nav-header">Gérer votre annonce</li>
	    <li><a href="<?php echo $CFG->config['base_url'].'annonce/gerer/modifier/'.$annonce->prd_id?>"><span class="icon-user"></span> Modifier</a></li>
	    <li><a href="<?php echo $CFG->config['base_url'].'annonce/gerer/supprimer/'.$annonce->prd_id?>"><span class="icon-trash"></span> Supprimer</a></li>
	    <li><a href="<?php echo $CFG->config['base_url'].'annonce/gerer/remonter/'.$annonce->prd_id?>"><span class="icon-arrow-up"></span> Remonter en tête de liste</a></li>
	    <li><a href="<?php echo $CFG->config['base_url'].'annonce/gerer/avant/'.$annonce->prd_id?>"><span class="icon-star "></span> Mettre en avant</a></li>
    </ul>
</aside>
</div>
<br  class="clear"/>